﻿using AMM.Model;
using AMM.Model.Store;

namespace AMM.UserControls {
    public partial class QualityOrderSearchControl : BaseSearchControl {

        public override BaseSearchModel GetSearchModel() {
            QualityOrderSearchModel searchResult = new QualityOrderSearchModel();
            searchResult.QualityOrderCode = this.tbSuspenseOrderCode.Text;
            searchResult.MaterialCode = this.tbMaterialCode.Text;
            searchResult.SuspenseOrderCode = this.tbSuspenseOrderCode.Text;
            searchResult.QualityDateStart = this.GetDateTimePickerValue(this.dtpQualityDateStart);
            searchResult.QualityDateEnd = this.GetDateTimePickerValue(this.dtpQualityDateEnd);

            return searchResult;
        }

        public override void ResetSearchModel() {
            this.tbSuspenseOrderCode.Clear();
            this.tbMaterialCode.Clear();
            this.tbSuspenseOrderCode.Clear();
            this.dtpQualityDateStart.Checked = false;
            this.dtpQualityDateEnd.Checked = false;
        }

        public QualityOrderSearchControl() {
            this.InitializeComponent();
        }
    }
}
